package com.hdax.dm.controller;

import com.hdax.dm.common.utils.CommonResponse;
import com.hdax.dm.common.utils.ResponseUtil;
import com.hdax.dm.exceptions.DmException;
import com.hdax.dm.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping(path = "/user/user")
public class UserLoginController {

    @Autowired
    private UserLoginService userLoginService;

    @PostMapping(path = "login")
    public CommonResponse login(@RequestBody Map<String,String> params){
        String phone = params.get("phone");
        String password = params.get("password");

        return userLoginService.login(phone,password);
    }

}
